package com.medical.data.domain;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Transient;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author cj
 * @since 2024-02-06
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="FormTemplate对象", description="")
@Accessors(chain = true)
public class FormTemplate implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;


    @ApiModelProperty(value = "用户id就是创建者id")
    private String userId;

    @ApiModelProperty(value = "表单名字")
    private String name;

    @ApiModelProperty(value = "父模版id")
    private String pId;

    @ApiModelProperty(value = "表单的类型：0表示节点，1表示普通表单，2表示随访表单")
    private String type;


    @ApiModelProperty(value = "表单样式的json")
    private String scheme;

    @ApiModelProperty(value = "是否填写完整，默认为0表示未填写完整，1表示填写完整")
    private Boolean status;

    @ApiModelProperty(value = "是否可添加组件，1为可添加，0为不可添加")
    private Boolean isAddItem;

    @ApiModelProperty(value = "模版描述")
    private String templateDesc;

    @ApiModelProperty(value = "在哪里建立的：0表示从节点中建立，1表示从表单管理建立的")
    private String buildStatus;

    @TableLogic
    @ApiModelProperty(value = "软删除：0代表未删除1代表删除")
    private Boolean isDelete;

    @Version
    @ApiModelProperty(value = "版本号")
    private Integer version;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    @ApiModelProperty(value = "0为非随访节点，1为随访节点")
    private Boolean isFollowUp;

    @ApiModelProperty(value = "随访间隔，以天为单位")
    private String FollowUpTime;

    @Transient
    @ApiModelProperty(value = "子模板")
    private transient List<FormTemplate> childrenFormTemplate;

}
